<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/1/19
 * Time: 21:19
 */

defined('BASEPATH') OR exit('No direct script access allowed');

class User_mod extends CI_Model
{
    public function __construct()
    {
        parent::__construct();

    }

    function add_user($username, $password, $email)
    {
        $data = array('username' => $username, 'password' => $password, 'email' => $email);
        $this->db->insert('user', $data);
        $res = $this->db->insert_id();
        return $res;
    }

    function getUser($where){
        $res = $this->db->get_where('user',$where);
        return $res->row_array();
    }
/*    function select_user(){
        $res = $this->db->get_where('user',array('username'));
    }*/

}
?>